-
Notifications
You must be signed in to change notification settings - Fork 9.9k
feat(model-availability): introduce ModelPolicy and PolicyCatalog #13751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @adamfweidman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes a robust framework for managing how the CLI interacts with different models, particularly when facing availability issues. It introduces a policy-driven approach to define fallback actions and state transitions, ensuring a more resilient and configurable system for handling various model failure scenarios like quota limits or transient errors. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a well-structured ModelPolicy and PolicyCatalog system to manage model availability and fallback logic. The changes are clear, well-tested, and provide a flexible foundation for handling model failures. The separation of policy definition from its application is a good design choice. I have one suggestion to improve type consistency in getModelPolicyChain.
|
Size Change: -2 B (0%) Total Size: 21.2 MB ℹ️ View Unchanged
|
…cy and PolicyCatalog (google-gemini#13751)
Summary
This PR introduces the
ModelPolicyandPolicyCatalogto enhance the management of model availability and fallback behavior within the CLI. It provides a structured way to define actions and state transitions based on different model failure kinds.Details
The primary goal is to provide a flexible and configurable mechanism for model fallback, user prompting, and error handling. This allows us to easily control how gemini-cli should act in response to quota limits, capacity problems, or transient errors per Model.
Related Issues
Fixes https://github.com/google-gemini/maintainers-gemini-cli/issues/1073
How to Validate
npm run preflight
Pre-Merge Checklist